package com.jianglin.ex;

import com.jianglin.vo.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author jianglin
 */
@ControllerAdvice
public class ExHandler {
    @ExceptionHandler(value = Exception.class)
    @ResponseBody
    public R exception(Exception e) {
        e.printStackTrace();
        return R.error(e.getMessage());
    }
}
